import  http from '@/utils/http'

// 查询此用户收藏的所有线路
export function getCollectLists(params){
    console.log(params)
    return http({
        method:'get',
        url:`web-collect/getList/${params}`,
    })

}
// 站点地图
// 获取所有站点
export function getAllSite(params){
    return http({
        method:'get',
        url:`mcrsegmentstationgs/getAllSite`,
        params:params
    })
}
// 站点地图
// 导出站点明细
export function exportDetailExcelData(params){
    return http({
        method:'get',
        url:`mcrsegmentstationgs/exportExcelData`,
        params:params,
        responseType: 'blob'
    })
}
// 获取距离乘客最近站点
export function getRecent(params){
    return http({
        method:'get',
        url:`web-collect/getRecent/${params}`,
    })
}
// 添加收藏
export function addCollect(data){
    return http({
        method:'post',
        url:'web-collect/add',
        data:data
    })
}
// 取消收藏
export function delCollect(data){
    return http({
        method:'post',
        url:`web-collect/delete`,
        data:data
        
    })
}

// 获取选中站点所有线路
export function getStationRoute(params){
    return http({
        method:'get',
        url:'web-collect/getStationRoute',
        params
    })
}


// 获取线路详情
export function getRouteDetail(params){
    console.log(params)
    return http({
        method:'get',
        url:`mcrsegmentstationgs/get/${params}`,
    })
}

// 收藏的线路
export function getCellectionList(params){
    return http({
        method:'get',
        url:`web-collect/getList/${params}`,
    })
}

// 添加用户搜索历史
export function addHistory(data){
    return http({
        method:'post',
        url:'web-history/add',
        data:data
    })
}
// 查看用户搜索记录
export function getHistory(params){
    return http({
        method:'get',
        url:`web-history/${params}`,
    })
}
// 获取车辆实时位置（地图）
export function getRealTimeGps(params){
    return http({
        method:'get',
        url:`mcrsegmentstationgs/getRealTimeGps/${params}`,
    })
}
// 获取车辆实时位置（旧）
export function getTheRealTimeLocation(params){
    return http({
        method:'get',
        url:`mcrsegmentstationgs/getTheRealTimeLocation/${params}`,
    })
}
// 获取车辆实时位置（新）
// export function getTheRealTimeLocation(params){
//     return http({
//         method:'get',
//         url:`http://124.70.163.49:8080/api/BusService/realTimeArrival`,
//         params:params
//     })
// }
// 用户注册
export function postRegister(data){
    return http({
        method:'post',
        url:`web-user/add`,
        data:data
    })
}

// 用户登录
export function postLogin(data){
    return http({
        method:'post',
        url:`web-user/signIn`,
        data:data
    })
}

// 获取用户头像
export function getAvator(param){
    return http({
        method:'get',
        url:`web-image/${param}`,
    })
}

// 获取用户信息
export function getUserInfo(param){
    return http({
        method:'get',
        url:`web-user/${param}`,
    })
}

// 修改用户信息
export function updateUserInfo(data){
    return http({
        method:'post',
        url:`web-user/edit`,
        data:data
    })
}


// 修改用户语言类型
export function updateLanguage(params){
    return http({
        method:'get',
        url:`web-user/updateLanguage/${params}`,
    })
}
// 线路规划，获取所有到达站点
export function postRoutePlanning(data){
    return http({
        method:'post',
        url:`route_planning/plan`,
        data:data
    })
}
// 通过起点和终点经纬度获取路程
export function getDistance(params){
    return http({
        method:'get',
        url:`route_planning/getDistance`,
        params:params
    })
}

// 删除单个历史记录
export function delHistory(params){
    return http({
        method:'get',
        url:`web-history/delete/${params}`
    })
}
// 删除全部历史记录
export function delAllHistory(params){
    return http({
        method:'get',
        url:`web-history/deleteAll/${params}`
    })
}
// 忘记密码
export function forgotPassword(data){
    return http({
        method:'post',
        url:`web-user/updatePassword`,
        data:data
    })
}
// 获取反馈类型
export function getProblemType(params){
    return http({
        method:'get',
        url:`web-problem-type/getAll/${params}`,
    })
}

// 提交反馈
export function addFeedback(data){
    return http({
        method:'post',
        url:`web-feedback/add`,
        data:data
    })
}

// 获取反馈列表
export function getFeedbackLists(params){
    return http({
        method:'get',
        url:`web-feedback/list/${params}`
    })
}
//删除反馈
export function delFeedback(data){
    return http({
        method:'post',
        url:`web-feedback/delete`,
        data:data
    })
}
// 模糊搜索线路
export function getRouteInfo(params){
    return http({
        method:'get',
        url:`/web-collect/getRouteInfo`,
        params
    })
}
// 计划时刻  
export function getPlanTime(params){
    return http({
        method:'get',
        url:`/fdisdisplan/getPlanTime`,
        params
    })
}
// 公告通知
export function getMessageinfos(params){
    return http({
        method:'get',
        url:`/api/getMessageinfos`,
        params
    })
}
// 获取实时车辆达到信息
export function getPredict(params){
    return http({
        method:'get',
        url:`/fdisdisplan/getPredict`,
        params
    })
}



export function getAddress(data){
    return http({
        method:'post',
        url:`https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyBpf9DOqJd_e2z_2ZHZ4KUp4rc4mmOa45o`,
        data:data
    })
}

export function getDirections(data){
    return http({
        method:'get',
        url:`https://maps.googleapis.com/maps/api/directions/json?region=ET&origin=35.96939293796699,120.23111343383789&destination=35.97793672297864,120.2025318145752&sensor=false&key=AIzaSyBpf9DOqJd_e2z_2ZHZ4KUp4rc4mmOa45o&language=zh-CN&mode=walking`,
    })
}



